// Header File
// Created 11/19/2007; 5:54:01 PM

#ifndef __CITY_H__
#define __CITY_H__

#include "Globals.h"
#include "BitArray.h"
#include "Building.h"
 
// City Structure
typedef struct
{
	int x, y;
	
	char name[16];
	char population;
	char food;
	int foodStorage;
	char production;
	char trade;
	char science;
	char luxury;
	
	char resourceEmph;
	
	char underProduction;
	char underProdType;
	int productionCurr;
	
	BitArray buildings[BUILDING_NUMBER/8+1];
	
	char happy;
	char content;
	char unhappy;
} City;
		 
// happy faces
unsigned short int hFace[9] =  {0x1C00,0x2200,0x4100,0x9480,0x8080,0xA280,0x5D00,0x2200,0x1C00};
unsigned short int cFace[9] =  {0x1C00,0x2200,0x4100,0x9480,0x8080,0x8080,0x5D00,0x2200,0x1C00};
unsigned short int uFace[9] =  {0x1C00,0x2200,0x4100,0x9480,0x8080,0x8880,0x5500,0x2200,0x1C00};

////////////////////////////
// City Methods ////////////
////////////////////////////
void NewCity(char civ, char name[], int x, int y, char emph);
void GrowCity(char civ, char city);
bool BuildCity(char index, char civ);
void RemoveCity(char index, char civ);
void ViewCity(char civ, char index);
char GetCityIndex(char civ);
bool ActionCity(char num);
bool IsCityAt(char civ, int x, int y);
bool ShowCityUnits(char civ, char city);
void ShowProductionWindow(char civ, char city);
void ChangeProductionWindow(char civ, char city);
void GetResources(char i, char j, int x, int y, char *r, char emph, char civ, char city);
void CalculateResources(char civ, char city);
void CalculateTrade(char civ, char city);
void CalculateHappiness(char civ, char city);
void AddBuildings(char civ, char city);
void AI_DoCities(char civ);
void AI_UpdateCityProduction(char civ, char city);

#endif
